home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlb20 / lib / fcntl.c < prev    next >
C/C++ Source or Header  |  1990-09-08  |  406b  |  29 lines

  1. /*
  2.  * fcntl() emulation for MiNT; written by Eric R. Smith and placed
  3.  * in the public domain
  4.  */
  5.  
  6. #include <errno.h>
  7. #include <mintbind.h>
  8. #include <fcntl.h>
  9.  
  10. extern int __mint;    /* MiNT version */
  11.  
  12. int fcntl(f, cmd, arg)
  13.     int f, cmd;
  14.     void *arg;
  15. {
  16.     long r;
  17.  
  18.     if (__mint) {
  19.         r = Fcntl(f, arg, cmd);
  20.     }
  21.     else
  22.         r = -EINVAL;
  23.     if (r < 0) {
  24.         errno = -r;
  25.         r = -1;
  26.     }
  27.     return r;
  28. }
  29.